package com.xkdx.guangguang.fragment.user;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.xkdx.guangguang.module.network.AbsModule;

public class UserResetPwdCommitModule extends AbsModule {

	public CommitVertifyCodeInfo commitCode;
	JSONArray jsonArray;
	JSONObject jsonObj;
	@Override
	public void parseData() throws Exception {

		try {
			commitCode = new CommitVertifyCodeInfo();
			jsonArray = (JSONArray) result;
			jsonObj = (JSONObject) jsonArray.get(0);

			commitCode = parserUserResetPwdCommit(jsonObj
					.getJSONObject("Content"));
		} catch (Exception e) {
			throw e;
		}

	}

	private CommitVertifyCodeInfo parserUserResetPwdCommit (
			JSONObject userResetPwd) throws Exception{

		try {
			JSONObject stut = (JSONObject) userResetPwd.get("Result");
			if (stut.getString("ErrorCode") != null
					&& !("".equals(stut.getString("ErrorCode")))) {
				commitCode.setErrorCode(stut.getString("ErrorCode"));
			} else {
				commitCode.setErrorCode("");
			}
			commitCode.setMessage(stut.getString("Message"));
			commitCode.setType(stut.getString("Type"));
			commitCode.setStatus(stut.getString("Status"));
		} catch (JSONException e) {
			throw e;
		}
		return commitCode;
	}

	public class CommitVertifyCodeInfo {

		private String Type;
		private String Status;
		private String ErrorCode;
		private String Message;

		public String getType() {
			return Type;
		}

		public void setType(String type) {
			Type = type;
		}

		public String getStatus() {
			return Status;
		}

		public void setStatus(String status) {
			Status = status;
		}

		public String getErrorCode() {
			return ErrorCode;
		}

		public void setErrorCode(String errorCode) {
			ErrorCode = errorCode;
		}

		public String getMessage() {
			return Message;
		}

		public void setMessage(String message) {
			Message = message;
		}

	}

}
